package guoanmaker.personal.business.repository;

import java.util.Date;
import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import guoanmaker.personal.business.model.OperatorCode;



public interface OperatorCodeRepository extends JpaRepository<OperatorCode, String>, JpaSpecificationExecutor<OperatorCode> {

	@Query("select c from OperatorCode c where c.phone=:phone and c.codetext=:codetext and  c.date>=:date")
	public  OperatorCode  selectByObject(@Param("phone") String phone,@Param("codetext") String codetext,@Param("date") Date date);
	
	
	@Query("select c from OperatorCode c where c.phone=:phone order by c.date desc")
	public List<OperatorCode> findCodeByTelephone(@Param("phone")String phone);
}
